FROM openeuler/openjdk:23_13-oe2203sp3

# 设置工作目录
WORKDIR /openmind-hub

# 安装必要的工具和依赖
RUN yum install -y git && \
    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
    python3 get-pip.py && \
    rm get-pip.py

# 克隆项目代码
ARG git_user
ARG git_pwd
RUN git clone -b v0.9 https://${git_user}:${git_pwd}@gitee.com/openmind-ai/openmind-hub.git /openmind-hub
RUN git clone https://${git_user}:${git_pwd}@gitee.com/opensourceway/test-management.git /openmind-hub/auto_test

# 安装 Python 依赖
RUN pip3 install --no-cache-dir -e .[all] && \
    pip3 install --no-cache-dir -r auto_test/autotest/requirements.txt

# 修改权限
# RUN chmod +x /openmind-hub/auto_test/autotest/run*.py

RUN useradd -u 1000 -m appuser  
RUN chown -R 1000:1000 /openmind-hub/
USER appuser

ENTRYPOINT ["sh", "-c", "python3 /openmind-hub/auto_test/autotest/run_modelers.py && python3 /openmind-hub/auto_test/autotest/run_huggingface.py && python3 /openmind-hub/auto_test/autotest/run_giteeAI.py && python3 /openmind-hub/auto_test/autotest/run_gitcode.py && python3 /openmind-hub/auto_test/autotest/run_openi.py"]